Abstract Sexually transmitted infections (STI) rates are at an all-time high in the US, with striking increases of gonorrhea (GC), chlamydia (CT), and syphilis among men who have sex with men (MSM). Pre-exposure prophylaxis (PrEP) against HIV is increasingly being used by at-risk MSM populations in the US; remarkably, this population has bacterial STI incidence rates as high as >50% per year. MSM living with HIV are also disproportionately impacted by STIs, with high incidence and reinfection rates of syphilis, 50% higher rates of GC and 30% higher rates of CT compared to MSM without HIV. These data highlight the pressing need for innovative and effective strategies to reduce STIs in high-risk MSM, both those living with HIV and HIV-negative MSM taking PrEP. One potential STI control strategy is post-exposure prophylaxis (PEP) with doxycycline. This strategy demonstrated efficacy in a recent randomized open-label trial in 232 HIV-negative MSM on event-driven PrEP in France (IPERGAY study). Doxycycline PEP resulted in a 47% relative reduction in new bacterial STIs (GC, CT, or syphilis), with rare adverse events and no difference in self-reported sexual behavior between arms. However, IPERGAY participants were older, mostly Caucasian and college educated, and highly adherent to event driven PrEP (as opposed to daily PrEP, the US norm). Thus, the results of the IPERGAY doxycycline PEP study may not reflect the advantages and risks of this strategy in diverse populations, including MSM living with HIV, whose adherence, sexual practices, and sexual networks may differ from HIV-uninfected MSM. Furthermore, a previously unexplored and important concern about doxycycline PEP is selection of antibiotic resistance among the target bacterial STI pathogens, colonizing bacteria that can cause disease (e.g., Staph aureus), commensal Neisseria spp which could transmit tetracycline (TCN) resistance genes to GC, and in the gut microbiome which may serve as a reservoir of transmissible TCN resistance to colonic microbiota. Based on the IPERGAY data, doxycycline PEP appears to be a promising innovative strategy to address the STI epidemic, particularly among higher risk MSM with a history of STIs and condomless sex. A sufficiently-powered, high-quality study is needed to evaluate the effectiveness in both MSM living with HIV and MSM on PrEP and the impact on drug resistance in the target bacterial STIs and normal host microbiota. We propose a randomized open label trial to assess the effectiveness of doxycycline PEP and impact on antibiotic resistance in 380 MSM living with HIV and 380 MSM on PrEP at public health clinics in San Francisco and Seattle. Our Specific Aims are to: 1) Evaluate the effectiveness, tolerability, acceptability, and adherence profile of doxycycline PEP to reduce STI incidence among MSM taking PrEP or living with HIV. 2) Assess the effect of doxycycline PEP on selection of tetracycline resistance in Neisseria gonorrhoeae, Staphylocccus aureus and commensal flora, including Neisseria spp and the gut microbiome. This study will provide critical data about doxycycline PEP in 2 cities with high PrEP coverage and high STI rates in order to inform policy.